selector: Rework iterating over subnodes
authorBenjamin Otte <otte@redhat.com>
Tue, 28 Jan 2020 02:53:48 +0000 (03:53 +0100)
committerBenjamin Otte <otte@redhat.com>
Tue, 28 Jan 2020 03:32:15 +0000 (04:32 +0100)
commitc7dca199ae344dca6914f4a534652a4aa8a99fda
tree0e07cc1dcd88c2f048aead70c68b58c367fe86d7
parent50a3d9be6ace732b354fe779a418eb7728041f30
selector: Rework iterating over subnodes

Instead of a foreach() function, introduce an iterator, so that the
caller can drive the iteration.

This allows doing stuff inbetween callbacks and avoids closures when
more than one data object should be passed.

As a side effect I even get a small, but noticeable performance
improvement in the 2-10% range depending on benchmark, I guess that's
because there's no function pointer passing going on anymore.
gtk/gtkcssprovider.c
gtk/gtkcssselector.c
gtk/gtkcssselectorprivate.h